This application claims the priority benefit of Taiwan application serial no. 89103351, filed Feb. 25, 2000.
1. Field of the Invention
The present invention relates to a method for canceling echo. More particularly, the present invention relates to a method for canceling echo, by which echo can be canceled successfully when the echo is very large.
2. Description of the Related Art
An echo canceller is commonly used in a handset of a phone to eliminate unnecessary echo. For example, while transferring a two-line system to a four-line system in a telephone network, an echo occurs if the impedance matching is not met, or, in a speaker phone, the voice is reflected in the chamber-like space to produce an echo. However, the conventional echo canceller can only eliminate the echo in one direction. Only during a one-directional talk (the direction that produces the echo) can the echo canceller adjust a coefficient for eliminating the echo. However, when the coefficient is not ideally convergent, a double talk detector is required to detect the one-direction talk.
Various methods of fabricating double talk detectors have been developed. In the following paragraphs, two common types of double talk detectors are introduced.
As shown in FIG. 1, a conventional echo canceller 14 is coupled between a receiving line (input line) 10 and an output line 12. The receiving line 10 has a terminal used as a first input terminal 16 for receiving an external input signal Rin and a terminal used as a first output terminal 18 for an external output signal Rout. The output line 12 has a terminal used as a second input terminal 20 for an acoustic input signal Sin and a terminal used as a second output terminal 22 for an acoustic output signal Sout. The external output signal Rout is output via a receiving set 24 while the microphone 26 outputs the acoustic input signal Sin at the second input terminal 20. Between the receiving set 24 and the microphone 26, the output signal of the receiving set 24 overlaps with the acoustic input signal Sin to cause an echo 28. Meanwhile, the double talk detector of the echo canceller has to start detecting to effectively eliminate the echo 28.
For a first type of double talk detector in a echo canceller, when the acoustic input signal Sin has a magnitude larger a half of the external output signal Rout, it is thus determined as a double talk that immediately freezes the coefficient adjustment of the echo canceller. This method can be applied as a line echo canceller. However, this kind of echo canceller cannot be applied to an echo canceller required for a receiving set since the distance between the speaker and the microphone is variable and causes variable magnitudes of echoes.
A second type of double talk echo canceller determines the value of echo return loss enhancement (ERLE), wherein
ERLE=Sin/Sout
When ERLE is larger than a certain constant, the echo coefficient is adjusted. In this manner, ERLE can effectively determine when the coefficient is convergent. However, before being convergent, an error can latch up the coefficient of the echo cancellation. The echo coefficient thus can never be converged.
FIG. 2 shows a detailed structure of a conventional echo canceller 14 in FIG. 1.
In FIG. 2, the echo canceller 14 comprises two voice detectors 30 and 32, a double talk detector 34, an echo return loss enhancement device 36, an adaptive filter 38 and a subtractor 40. According to the structure of FIG. 2, the acoustic output from the receiving set 24 may be transmitted to the microphone 26 via space collision to cause an echo. Because the space characteristic may be changed momentarily, the adaptive filter 38 is required for tracking the impulse response of an echo. However, the reason for turning on the adaptive filter 38 as well as a study mechanism is the edge of line talked and the edge of air untalked; thus, the acoustic is determined from the edge of air to be an echo and the adaptive filter 38 is turned on. Therefore, in FIG. 2, the voice detectors 30 and 32 are used for determining whether the edge of line and air are talked, and the double talk detector 34 is used for determining whether an echo from the edge of air is too large.
Thus, according to the structure of the conventional echo canceller, when an echo is not large, the operation can be processed smoothly. However, when the echo is large and the echo has a magnitude larger than half the power of the edge of line, it is thus determined that the edge of air is talked even though the edge of air is untalked, so that the adaptive filter cannot be turned on and the echo cannot be eliminated effectively.
The invention provides a method for canceling echo. First, a threshold value signal is set to a preset value and the threshold value signal and a medium value signal are kept at a level of the preset value. Then, whether a difference between an echo signal (I) and the medium value signal (I-1) is more than a positive threshold value or less than a negative threshold value is determined. When the difference between an echo signal (I) and the medium value signal (I-1) is more than the positive threshold value, the level of the medium value signal (I) is increased by an upraise speed and the level of the threshold value signal (I) is increased by a first speed faster than the upraise speed. When the difference between the echo signal (I) and the medium value signal (I-1) is less than the negative threshold value, the level of the medium value signal (I) is decreased by a drop speed and the level of the threshold value signal (I) is decreased by a second speed faster than the drop speed. When the difference between the echo signal (I) and the medium value signal (I-1) is not more than the positive threshold value or not less than the negative threshold value, which represents the level of the echo signal (I) in an normal range without adjusting the threshold value, the symbol (I) represents a present condition of a corresponding signal and the symbol (I-1) represents a previous condition of a corresponding signal.
A method for canceling echo according to the invention is described, which method can successfully eliminate the echo by turning on the adaptive filter in the echo canceller through the voice detector when an echo is large.
Both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.